home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / util1 / pf2.lha / patchfor020.doc < prev   
Text File  |  1995-09-12  |  20KB  |  449 lines

  1. ______________________________________________________________________________
  2.  
  3.                                     /
  4.                                                                      /
  5. \                               /\/                               /\/
  6.                                /                                     
  7.    \              _________ ____ ____ ____ ____     /\      /
  8.           .---\_  __  /|    ¡    |    ¡    |----.      /
  9.           |:::|      / |    |    |    |    |::::|  \  /
  10.           |:::|     ___|__  |  __|    |    |__.:|   \/
  11.           |:::|    |   |         |            |:|
  12.           |:::|    ¡   |    ¡    |----.    .--':|
  13.          /|:::|        |    |    |    |    |::::|
  14.         / `---^--------^----^----'    `----^----'
  15.     \  /                                              \                /
  16.      \/       /   »»»»»-[ pRoUDLY pReSeNTS ]-««««««         /\        /
  17.              /                                          \  /  \      /
  18.         /\  /                                            \/    \    / 
  19.        /  \/                                                    \  /
  20.       /                     "PatchFor020"                        \/
  21.  
  22.     /  A tool which patches MC68000 specific routines in Executables files to
  23.     their MC68020 equivelents to improve performance on 020`CPU`s and above!
  24.  
  25.  
  26.                         An EX4-Production for `95!
  27.  
  28.          ** NB: Requirements: OS2+, MC68020+ & "reqtools.library" **
  29. ______________________________________________________________________________
  30.  
  31.  
  32.  
  33.                                Introduction
  34.            -----------------------------------------------------
  35.  
  36. This program was written specifically to get some speed gains on MC68020+`s
  37. processors running software which has been compiled for the bog standard
  38. MC68000 processor. Most software has not been specifically compiled for
  39. faster processors and hence the potential for speed improvements are great.
  40.  
  41. On the 68000 processor there existed only multiplication & division routines
  42. for 16-bit numbers, on 68020`s and above divide & multiply instructions have
  43. been given extended precision. The 68020 can perform 32x32->32, 32x32->64 
  44. multiplication and 32/32 and 64/32 division. These are significantly faster 
  45. than the multi-precision operations which are required on the 68000. This was
  46. because in order to carry out any 32 Bit multiply or divides on the 68000 
  47. compilers where required to link in about three pages full of assembly code.
  48. This method not only wastes considerable amount of processor cycles, but 
  49. completly fails to take advantage of 68020, it can do the same calculation 
  50. in ONE instruction (excluding the RTS!) !
  51.  
  52. The program is based around ideas in a program called 'PatchMath020'.. that
  53. program tried to do similar things as this program.. infact it does indeed
  54. support 'Manx C' maths routines a few 'Lattice' function (but not all of 
  55. them!) ... My version supports 16 different strains and versions from
  56. the latest popular Amiga compilers including Lattice SAS/C, DICE, Manx, 
  57. Maxon, etc, etc, etc.
  58.  
  59. My program is like a replacement for his program, his could only patch a very 
  60. limited amount of programs since it knew so few. The only patch my one does
  61. not do that his does is his special case 'Turbo Silver' patch. At the moment
  62. don`t expect great gains from patching ray tracers since most maths functions 
  63. are sprawled all over the code instead of calling the compiler mul/div 
  64. functions. In the future I may consider doing special case patches for some
  65. particular programs to give them some *real* speed injections to their maths 
  66. functions. Some possible ones I`m thinking about are real maths intensive 
  67. programs like ray tracers such as "LightWave" and "Imagine"...  This all
  68. depends on if there is enough support for the idea, I know I could get these 
  69. slow "c" coded dinosaurs to got around 30 or 40% faster if I really tried... 
  70. What with code like 'divu #2,Dn' and so on... Anyone want to convice me its 
  71. worth the work?? 
  72.  
  73. Anyway, this was a quick few hours jobby, it does the trick, works fine but
  74. isn`t as well coded as it could have been (a bit unstructured!) I originally
  75. thoughed there was only about 6 different strains, it turns out that there
  76. are way in excess of 16+...  anyway I hope you like it and enjoy using your 
  77. patched programs faster!!!
  78.  
  79.  
  80.                        All The best from 2-Cool/EX4!
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.                               How it works..
  88.             --------------------------
  89.  
  90. For people who are sceptical that this program is a fake or a virus or
  91. something then please read below to remove your fears... Infact take a
  92. look at the source-code or even re-assemble it.. (THE FULL SOURCE-CODE
  93. IS SUPPLIED IN THE ARCHIVE! - SEE I`VE GOT NOTHING TO HIDE!)
  94.  
  95. This program scans a program looking for the standard MC68000 compiler
  96. produced maths functions and then replaces them with the faster MC68020
  97. equivelent code hence speeding up all maths functions in the program
  98. which used these routines.
  99.  
  100. Most programs written and compiled using the popular C language compiler
  101. development systems use these standard 'maths' routines for dividing and 
  102. multiplying functions. This is even the case if the Program has been
  103. specifically compiled for MC68020... (Will compiler writers ever learn?)
  104.  
  105. Many programs that use 32-bit maths intensively will run significantly
  106. faster after being pached by this program. Some programs after patching
  107. run 2 or even 3 times FASTER than the originals! On the average most
  108. programs will benefit from about 15 to 20% speed gains, which is better
  109. than nothing! It will depend entirely on how many calculations a program
  110. does using the patched routines..
  111.  
  112.  
  113.  
  114.                              The Patch List..
  115.             -------------------------
  116.  
  117. As this program is a generic patcher, currently not supporting any 
  118. specific optimisation patches it will patch MANY MANY programs. Infact at 
  119. a rough guess I would say about 2 thirds of all your software, be them,
  120. applications, utilities, tools, devices, libraries, datatypes, handlers,
  121. even games!
  122.  
  123.    Here`s a quick list of some popular programs which when patched are 
  124.                                  sped up!
  125.  
  126. -----------------------------------------------------------------------------
  127. Workbench             - tested on many WB3.0 files, including 
  128.                 - most "sys:prefs/#?" files, "sys:libs/#?"
  129.                 - "sys:l", "sys:devs", datatypes, etc.!
  130. Lattice SAS/C Compiler        - All amiga-shared libraries, lib:sc.lib,
  131.                 - and all executables even including the
  132.                 - compiler itself and all its libraries!
  133. DICE C Compiler            - most executables even including the
  134.                 - compiler itself and all its utilities
  135.                 - and linker libraries!
  136. Installer (Commodore)        - main program
  137. MUI                - main library
  138. ProCalc                - main program
  139. LightWave3D            - main program & also 'LightRave'
  140. Maxon Cinema-4D            - main program (also tested on demo versions)
  141. Devpac                - main text editor
  142. Twist                - main program
  143. MainActor            - main program
  144. AmiBack                - main program & tools suite
  145. Deluxe-Paint            - main program
  146. Personal-Paint            - main program
  147. Photogenics            - main library, 'pgs.library'
  148. Directory-Opus            - main program
  149. Final-Writer            - main program and most 'fwlibs' libraries
  150. Studio                - main program, CMSEdit, Printer Prefs, etc.
  151. GP-Fax                - main program and view fax program
  152. DMS (DiskMasher)        - both shell and gui versions
  153. Digita Organiser        - main program
  154. CygnusEd Professional        - main program
  155. PowerPacker            - main program
  156. PowerData            - main program
  157. Snap                - main program
  158. ARTM                - main program
  159. ACalc                - main program
  160. Arq                - main program
  161. FJPeg                - main program
  162. SuperView            - main program
  163. QuickGrab            - main program
  164. DiskExpander            - some parts including DevicePacker, etc.
  165. GameSmith            - Actual link-lib, CITAS, etc, even GS Games!
  166. GadToolsBox            - main program
  167. LhA-Windows            - main program
  168. LhA                - main program
  169. LZX                - all versions including 020 & 040
  170. Ami-Express            - main program & ACP Server
  171. S-Express            - main program & ACP Server
  172. PGP (Pretty Good Privacy)    - main program
  173. NComm                - main program
  174. Term                - main program
  175. FTerm                - main program
  176. ToolMaker            - main program
  177. SnoopDOS            - main program
  178. EasyCatalog            - main program
  179. CatComp                - main program
  180. CatEdit                - main program
  181. XModule                - main program
  182. ShowSTD                - main program
  183. PlusEd                - main program
  184. KingCON                - handler file usually located in l: dir
  185. Printer-Manager            - main program
  186.  
  187. many many libraries, devices, datatypes, handlers, etc. ,etc. including 
  188. popular ones like 'libs:xprzmodem.library' , 'libs:bullet.library', 
  189. 'libs:datatypes.library', 'libs:amigaguide.library', etc. etc.
  190.                                    ----
  191. This list is absolutely NO MEANS complete in any way, try it with all your
  192. programs, it will NOT damage or even touch programs which do not contain any
  193. of the complier C functions..
  194.  
  195. This program doesn`t just stop at utilities/tools and so on, TRY it on
  196. games too, here`s just a few we`ve tried;
  197.  
  198.  
  199. 1. PGATour Golf
  200. 2. Gunship 2000
  201. 3. A-Train
  202. 4. Silent-Service II
  203. 5. Monkey-Island II
  204. 6. Sim-Life
  205.  
  206.  
  207. etc., etc. Infact these days many Software Houses have dropped using Assembly
  208. language (sob..) so you`ll find many many games that can be patched too.. A 
  209. shame since they are just wasting the Amiga`s true potential... This program
  210. was written fully in assembly language ... hooray...): .. 
  211.  
  212.  
  213.  
  214. ------------------------------------------------------------------------------
  215.   PLEASE NOTE THAT BEFORE PATCHING *ANY* PROGRAMS, "MAKE A BACKUP COPY!"
  216.           OR SAVE THE PATCHED VERSION UNDER A DIFFERENT FILENAME!
  217.  
  218.     This is very important since some programs have checksum protection
  219.    in to stop people modifying or trying to crack the registrations and
  220.     if patched will just crash due to the code failing the checksums..
  221.  
  222.                ALSO NOTE THAT THE NEW PATCHED PROGRAMS WILL 
  223.                 *** CRASH OR ENTIRELY LOCKUP THE SYSTEM ***
  224.               ON ANYTHING LOWER THAN AN MC68020.. HENCE DON`T
  225.         TRY THEM ON STANDARD A500`S OR OTHER AMIGA`S WITH MC68000`s
  226.  
  227. -------------------------------------------------------------------------------
  228.  
  229.  
  230.  
  231.  
  232.                             Using the Program
  233.                      ---------------------------------
  234.  
  235. In order to use this program to its maximum you`ll need an executable file 
  236. unpacker.. This is especially true for games you may wish to patch since many
  237. come supplied in compressed format (to save diskspace). I recommend either
  238. the "XFD" package or "DLD" .. Both are varients from the same author, both
  239. allow easy transparent decompression of the many different compressed formats.
  240.  
  241. Once your sure that the program(s) you wish to patch are unpacked you can
  242. use the program in full AUTOMATIC BATCH mode...
  243.  
  244. Simply Enter its name from any Shell or CLI window;
  245.  
  246. 1> PatchFor020      <Hit Return>
  247.  
  248. You will then be prompted with a file requester with multi-selection
  249. capabilities... simply select an entire directory , e.g. the "libs:" dir
  250. then click on "ALL" on the requester to select all the files within it..
  251. You will be prompted with a further file-requester.. now you can select the 
  252. DESTINATION.. the destination is where all the patched versions of the programs
  253. will be placed... You can select <source> and <dest> as the same but I`d 
  254. strongly recommend to make backups of the files you are about to patch!
  255. Also if you select NO DESTINATION and click on cancel the patched files
  256. will be saved with an '.020' filename extension...
  257.  
  258. NB: Also take note that if a file cannot be patched it will be skipped, and
  259. no saving of that particular file will take place...
  260.  
  261. Sorry about the sparse documents, but hey..its pretty simple to use.. -):
  262.  
  263.  
  264.  
  265.  
  266.                              Scope for Future
  267.                     ----------------------------------
  268.  
  269. The more maths varients I come across the more I`ll add, also mentioned 
  270. elsewhere in this document I *may* add some application specific speed up 
  271. patches. Currently this program only patches 'maths' routines in the future
  272. I`m considering replacement of other speed critical functions such as 
  273. standard compiler 'searching' routines, and so on.. this could benefit word
  274. processors and text editors, etc... 
  275.  
  276. SORRY that the source is so rushed and badly written.. No.. I didn`t
  277. bother using PC-Relative addressing off a base register like a4 or a5! 
  278. (slapped rist`s eh P0T-NOODLE? ) and I *should* have used some sort of 
  279. linked list of structures for easy adding of extra checks.. but hey.. this
  280. doc took longer to write than the program.. look out for the next version 
  281. for a better source.. it will be FAR better... just haven`t had the time 
  282. yet...
  283.  
  284.  
  285. -------------------------------------------------------------------------------
  286.  
  287.  
  288.                              Disclaimer Notice
  289.             ---------------------------
  290.         No warrenties express or implied, use this program entirely
  291.        at your OWN risk.. If you trash one of your beloved programs
  292.        don`t come crying back to EX4.. Don`t say we didn`t warn you
  293.                             to keep backups!!!!
  294.  
  295.  
  296.  
  297.  
  298.  
  299.                                  Thanks to
  300.                          ------------------------
  301.  
  302.   Arthur Hagen, author of "CopyMemQuicker".. the routine is used in the 
  303.                      program for copying the patches,
  304.  
  305.           Nico Fraçias, author of the useful "Reqtools.library"..
  306.  
  307.                 Author of "PatchMatch020" for inspiration, 
  308.              (don`t know his name because it wasn`t specified)
  309.  
  310.  
  311.  
  312.  
  313.                                Handshakes to
  314.                        ----------------------------
  315.  
  316.       THIS IS A RELEASE FOR ALL THE NON BELIEVERS OUT THERE... EX4 IS
  317.                          REALITY! WE NEVER DIE!!!
  318.  
  319.  
  320.        Quick Personal golden handshakes & remarks from 2-Cool go out
  321.                    to the following kewl scene dudes..;
  322.  
  323.  
  324. The Art             Hey.. What does it feel like to be the only other person
  325.                  to know all the undisclosed hardware registers secrets ..
  326.                  feel the buzz ? keep up the game coding marathon man! soon
  327.                  we`ll be rich... -): v.soon!!!! )
  328.  
  329. Beldin         Welcome to EX4 Mate! <-- Newest EX4 Member! Hope you
  330.                  enjoy using your new found knowledge!! hehe )
  331.  
  332. Trixter             lets get that demo finished!.. eh, what demo?! heh)
  333.  
  334. Aquafresh     Thanks for sending me those music modules.. love
  335.                  the reconstruction of `WarHawk' from the C64! very kewl
  336.                  I`ll mail you soon. btw-) got anymore for us to listen
  337.                  to? Hope your pinball *dreams* (excuse the pun!) get
  338.                  fulfilled and you get back some decent $$$ back from the
  339.                  thomas-pinball music for that game...
  340.  
  341. Kid-Curry     How`s Pet-Sematary going these days?? Hope its `Buzzin'!)
  342.  
  343. Json         Hi m8! still hanging in there.. Hows Static Chaos!...
  344.                  Thanx for the greets m8!!
  345.  
  346. Sigma Seven     Are you still working on S-Express these days?? Give me
  347.                  a call some time soon huh!)
  348.  
  349. The Assassin     Love that level one module for "ATROPHY".. keep em 
  350.                  flowing!.. soon` we`ll be onto level 2 ... )
  351.  
  352. Zadd         Hey Darren you must come and visit me very soon !!!)
  353.  
  354. Data             Data.. hows the work on the Saturn & Sony Playstation
  355.                  working out?? managed to get your game engine sorted
  356.                  out yet?... chat with you v.soon man!
  357.  
  358. Cath!         Probably jetting off somewhere again!! ah! I don`t
  359.                  know.. every time I call you your somewhere else...
  360.                  Everytime you Call me you end up being some else too. 
  361.                  hehe :) I don`t know.. first USA, then JAPAN, etc. etc
  362.                  Hey give me a call Charley.. You`ll have to come and
  363.                  visit again v.soon.. Perhaps maybe we`ll go the Digital
  364.                  Party together... What games you working on now then??
  365.  
  366. P0T-Noodle       Hey.. hope your exams went fine mate.. Sorry if you`ve
  367.                  been e-mailing me at Uni.. I`ve not read my E-Mail for
  368.                  quite some time now.. been too busy coding to go into
  369.                  Uni to read my e-mail.. after all it is Holidays.. and
  370.                  yippe.. I passed all my exams... PHEW! hehe anyway GOOD
  371.                  LUCK.. give me a ring soon so we can chat about that 
  372.                  coding project ..
  373.  
  374. Picard           Is USS-Enterprise still online?? how ya doing these
  375.                  days m8!! Hope all is well in outer space!! hehe
  376.  
  377. Scooter             Steve! How ya doing these days.. converted to the PC yet!
  378.                  hehe!)
  379.  
  380. Hybrid           Digital Candy BBS is the coolest man! keep up the good 
  381.                  work and hopefully I`ll see you at the Digital Party 95!
  382.                  Happy to use your Great BBS as the OFFICIAL RELEASE
  383.                  site for the cool (and many more to come..) releases
  384.                  for EX4!!! Nice... )
  385.  
  386. Skylark         Hows ya doing man! is Skull offline these days?? hows
  387.                  everything.. jezzus.. it`s been a long time since we
  388.                  had a kewl chat.. miss`em. hope all is well for you! l8rs!
  389.                  Say quick hi`s to the Biker for me too...
  390.  
  391. Galahad          How`s Speris Legacy coming on?? getting behind scedule ?
  392.                  hehe.. bet those game testers are getting on your nerves
  393.                  now the pressures on huh!! hehe.. hi to Cyde too... !!)
  394.                  I`ll send that video as soon as we finish level 1...
  395.  
  396. Reflex&Renegade  Shit! I lost your phone number AGAIN! hehe trust me..
  397.                  give me a ring and tell me again man!! 
  398.  
  399. Sasha            Hows it going? Still think your name sound like you
  400.                  should be a Musician!! heh.. reminds me of a DJ` with
  401.                  the same name!! hehe
  402.  
  403. Axeman         Hey I`ve missed the 'kewl chats' since you went to
  404.                  University.. just becase your in London gives you no
  405.                  excuse for not occasionally e-mailing me or phoning..
  406.                  I`ll give you a call soon.. just that ringing your mobile
  407.                  costs me a small fortune.. get a real phone .heheh
  408.  
  409. N.O.M.A.D     Yep.. the original.. hehe great scott.. the name still
  410.                  lives on.. hehe just givin ya a big head man! -): how
  411.                  you going these days?? Seen "Bub" (aka the old Bub (steve)
  412.                  Bubble Bobble) recently in the Pub? heheh are you going to
  413.                  the Digital Party? If so chat 2 you there!!!)
  414.  
  415. Super-Grover     Whats happening with Alpha-flight these days?? Haven`t
  416.                  heard anything from you lot for ages... Hows the BBS ?
  417.                  Still into Rave ? I say I`d still swap any DJ in the Uk
  418.                  for your Awesome Florida beaches!! hehe
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.                              Copyright Notice
  426.                     ----------------------------------
  427.  
  428.                Designed & Written By 2-Cool/EX4 entirely in
  429.                            Assembly Language.
  430.  
  431.              Copyright EX4 (c) 1995. All Rights Are Reserved.
  432.  
  433.       The program itself may be freely distributed. However the program
  434.   and its source-code & documentation remain fully copyright to EX4 and 
  435.   its respective author(s). Permission is granted to put this on *NON*
  436.   profit making CD`s only! This program is NOT ALLOWED on *ANY* pay per 
  437.   minute (0898 style) commercial Bulletin Boards systems or equivelents. 
  438.  
  439.   YOU MUST NOT CHARGE ANY MONEY FOR TRANSFER, LOAN, HIRE OR USE OF THIS 
  440.   PROGRAM TO OTHER PARTIES, PEOPLE OR ORGANISATIONS. THE PROGRAM MUST BE 
  441.   DISTRIBUTED WITH THIS DOCUMENT AND ITS SOURCE-CODE. THE PROGRAM SOURCE
  442.   MUST NOT BE MODIFIED, PATCHED OR ALTERED IN ANY WAY THEN RE-DISTRIBUTED
  443.  
  444.  
  445.  
  446. ______________________________________________________________________________
  447.  
  448.  
  449.